package cn.wolfcode.mapper;

import cn.wolfcode.domain.Emp;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.Date;
import java.util.List;

public interface EmpMapper {

    List<Emp> list(String name, Integer gender, Date begin, Date end);

    void delList(@Param("ids") List<Long> ids);

    void add(Emp emp);

    @Select("select * from emp where id=#{id}")
    Emp getById(Long id);

    void edit(Emp emp);

    @Select("select * " +
            "from emp " +
            "where username=#{username} and password = #{password}")
    Emp login(Emp emp);

    @Delete("delete from emp where dept_id=#{id}")
    void delByDeptId(Long id);
}
